<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>科情服务 - 任务列表</title>
    <meta name="description" content="科情服务列表">
    <meta name="keywords" content="科情服务">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/morris/morris.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/select2/select2.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
</head>

<body class="hold-transition skin-purple sidebar-mini">
<div class="wrapper">
    <!-- 页面头部 -->
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 页面头部 /-->
    <!-- 导航侧栏 -->
    <jsp:include page="aside.jsp"></jsp:include>
    <!-- 导航侧栏 /-->
    <!-- 内容区域 -->
    <div class="content-wrapper">
        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                数据录入管理<small>科情服务任务单</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="${pageContext.request.contextPath}/index.jsp"><i
                        class="fa fa-dashboard"></i>首页</a></li>
                <li>数据录入管理</li>
                <li class="active">科情服务任务单</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content"> <!-- .box-body -->
<!-- .box-body -->
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">科情服务任务单列表</h3>
    </div>
    <div class="box-body">
        <!-- 数据表格 -->
        <div class="table-box">
            <!--工具栏-->
            <div class="pull-left">
                <div class="form-group form-inline">
                    <div class="btn-group">
                        <button type="button" class="btn btn-default" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/kqfwaddUI.do'" title="新建"><i class="fa fa-file-o"></i> 新建</button>
                        <button type="button" class="btn btn-default" onclick="window.location.reload();" title="刷新"><i class="fa fa-refresh"></i> 刷新</button>
                    </div>
                </div>
            </div>
            <div class="box-tools pull-right">
                <div class="has-feedback">
                    <form class="navbar-form navbar-left" role="search">
                        <div class="form-group">
                            <input type="serach" class="form-control" placeholder="Search" id="search-val">
                        </div>
                        <button type="submit" class="btn btn-info" id="btn-search">
                            <span class="glyphicon glyphicon-search"></span>
                        </button>
                    </form>
<%--                    <input type="text" class="form-control input-sm" placeholder="搜索">--%>
<%--                    <span class="glyphicon glyphicon-search form-control-feedback"></span>--%>
                </div>
            </div>
            <!--工具栏/-->
            <!--数据列表-->
            <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                <thead>
                <tr>
                    <th>序号</th>
                    <th class="sorting_asc sorting_asc_disabled">编号</th>
                    <th class="sorting_desc sorting_desc_disabled">任务名称</th>
                    <th class="text-center">下达时间</th>
                    <th class="text-center">完成时限</th>
                    <th class="text-center">随机码</th>
                    <th class="text-center">反馈资料路径</th>
                    <th class="text-center" style="min-width: 65px;">任务状态</th>
                    <th class="text-center">创建时间</th>
                    <th class="text-center">上次修改时间</th>
                    <th class="text-center" style="min-width: 260px;">操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${pageInfo.list}" var="task" varStatus="status">
                    <tr>
                        <td>${(pageInfo.pageNum-1)*pageInfo.pageSize+status.count}</td>
                        <td>${task.number}</td>
                        <td>${task.taskname}</td>
                        <td class="text-center">${task.givetimeStr}</td>
                        <td class="text-center">${task.timelimit}</td>
                        <td class="text-center">${task.code}</td>
                        <td class="text-center">${task.means_url}</td>
                        <c:if test="${task.status==1}">
                            <td class="text-center" style="color: red;font-weight: bold">待处理</td>
                        </c:if>
                        <c:if test="${task.status==2}">
                            <td class="text-center" style="color: #ff851b;font-weight: bold">待修改</td>
                        </c:if>
                        <c:if test="${task.status==3}">
                            <td class="text-center" style="color: #1b6d85;font-weight: bold">任务进行中</td>
                        </c:if>
                        <c:if test="${task.status==4}">
                            <td class="text-center" style="color: #605ca8;font-weight: bold">资料查找完成</td>
                        </c:if>
                        <c:if test="${task.status==5}">
                            <td class="text-center" style="color: #605ca8;font-weight: bold">完成</td>
                        </c:if>
                        <td>${task.create_timeStr}</td>
                        <td>${task.update_timeStr}</td>
                        <td class="text-center">
                            <c:if test="${task.status==1}">
                                <div class="btn-group btn-group-xs">
                                    <button type="button" class="btn bg-blue" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/taskInfo.do?id=${task.id}'">查看</button>
                                    <button type="button" class="btn bg-olive" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/updateTaskUI.do?id=${task.id}'">编辑</button>
                                    <button type="button" class="btn bg-orange" onclick="bh(${task.id},2)">驳回</button>
                                    <button type="button" class="btn bg-teal" onclick="updateStatus(${task.id},3)">处理</button>
                                    <button type="button" class="btn bg-fuchsia" data-toggle="modal" data-target="#uploadModal" onclick="up(${task.id})" disabled="disabled">上传资料</button>
                                    <button type="button" class="btn bg-purple" onclick="updateStatus(${task.id},5)" disabled="disabled">完成</button>
                                    <button type="button" class="btn bg-red" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/deleteTask.do?id=${task.id}'">删除</button>
                                </div>
                            </c:if>
                            <c:if test="${task.status==2}">
                                <div class="btn-group btn-group-xs">
                                    <button type="button" class="btn bg-blue" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/taskInfo.do?id=${task.id}'">查看</button>
                                    <button type="button" class="btn bg-olive" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/updateTaskUI.do?id=${task.id}'">编辑</button>
                                    <button type="button" class="btn bg-orange" onclick="updateStatus(${task.id},2)" disabled="disabled">已驳回</button>
                                    <button type="button" class="btn bg-teal" onclick="updateStatus(${task.id},3)">处理</button>
                                    <button type="button" class="btn bg-fuchsia" data-toggle="modal" data-target="#uploadModal" onclick="up(${task.id})" disabled="disabled">上传资料</button>
                                    <button type="button" class="btn bg-purple" onclick="updateStatus(${task.id},5)" disabled="disabled">完成</button>
                                    <button type="button" class="btn bg-red" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/deleteTask.do?id=${task.id}'">删除</button>
                                </div>
                            </c:if>
                            <c:if test="${task.status==3}">
                                <div class="btn-group btn-group-xs">
                                    <button type="button" class="btn bg-blue" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/taskInfo.do?id=${task.id}'">查看</button>
                                    <button type="button" class="btn bg-olive" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/updateTaskUI.do?id=${task.id}'">编辑</button>
                                    <button type="button" class="btn bg-orange" onclick="bh(${task.id},2)">驳回</button>
                                    <button type="button" class="btn bg-teal" onclick="updateStatus(${task.id},3)" disabled="disabled">已处理</button>
                                    <button type="button" class="btn bg-fuchsia" data-toggle="modal" data-target="#uploadModal" onclick="up(${task.id})">上传资料</button>
                                    <button type="button" class="btn bg-purple" onclick="updateStatus(${task.id},5)" disabled="disabled">完成</button>
                                    <button type="button" class="btn bg-red" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/deleteTask.do?id=${task.id}'">删除</button>
                                </div>
                            </c:if>
                            <c:if test="${task.status==4}">
                                <div class="btn-group btn-group-xs">
                                    <button type="button" class="btn bg-blue" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/taskInfo.do?id=${task.id}'">查看</button>
                                    <button type="button" class="btn bg-olive" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/updateTaskUI.do?id=${task.id}'">编辑</button>
                                    <button type="button" class="btn bg-orange" onclick="bh(${task.id},2)">驳回</button>
                                    <button type="button" class="btn bg-teal" onclick="updateStatus(${task.id},3)" disabled="disabled">已处理</button>
                                    <button type="button" class="btn bg-fuchsia" data-toggle="modal" data-target="#uploadModal" onclick="up(${task.id})">重传资料</button>
                                    <button type="button" class="btn bg-purple" onclick="updateStatus(${task.id},5)">完成</button>
                                    <button type="button" class="btn bg-red" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/deleteTask.do?id=${task.id}'">删除</button>
                                </div>
                            </c:if>
                            <c:if test="${task.status==5}">
                                <div class="btn-group btn-group-xs">
                                    <button type="button" class="btn bg-blue" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/taskInfo.do?id=${task.id}'">查看</button>
                                    <button type="button" class="btn bg-olive" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/updateTaskUI.do?id=${task.id}'">编辑</button>
                                    <button type="button" class="btn bg-orange" onclick="updateStatus(${task.id},2)" disabled="disabled" title="任务已完成，当前不可驳回！">驳回</button>
                                    <button type="button" class="btn bg-teal" onclick="updateStatus(${task.id},3)" disabled="disabled" title="任务已完成，不可重复处理！">处理</button>
                                    <button type="button" class="btn bg-fuchsia" data-toggle="modal" data-target="#uploadModal" onclick="up(${task.id})">重传资料</button>
                                    <button type="button" class="btn bg-purple" onclick="updateStatus(${task.id},5)">已完成</button>
                                    <button type="button" class="btn bg-red" onclick="window.location.href='${pageContext.request.contextPath}/kqfw/deleteTask.do?id=${task.id}'">删除</button>
                                </div>
                            </c:if>

                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <!--数据列表/-->
        </div>
        <!-- 数据表格 /-->
    </div>
    <!-- /.box-body -->
    <!-- .box-footer-->
    <div class="box-footer">
        <div class="pull-left">
            <div class="form-group form-inline">
                总共${pageInfo.pages}页，共${pageInfo.total} 条数据。 每页
                <select class="form-control" id="changePageSize" onchange="changePageSize()">
                    <option>&nbsp;5 </option>
                    <option selected>10</option>
                    <option>15</option>
                    <option>20</option>
                    <option>30</option>
                </select> 条
            </div>
        </div>

        <div class="box-tools pull-right">
            <ul class="pagination">
                <li>
                    <a href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=1&pageSize=${pageInfo.pageSize}" aria-label="Previous">首页</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=${pageInfo.pageNum-1}&pageSize=${pageInfo.pageSize}">上一页</a></li>
                <c:forEach begin="1" end="${pageInfo.pages}" var="pageNum">
                    <li><a href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=${pageNum}&pageSize=${pageInfo.pageSize}">${pageNum}</a></li>
                </c:forEach>
                <li><a href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=${pageInfo.pageNum+1}&pageSize=${pageInfo.pageSize}">下一页</a></li>
                <li>
                    <a href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=${pageInfo.pages}&pageSize=${pageInfo.pageSize}" aria-label="Next">尾页</a>
                </li>
            </ul>
        </div>
    </div>
    <!-- /.box-footer-->
    <%--上传反馈资料模态框--%>
    <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="uploadModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="uploadModalLabel">上传反馈资料</h4>
                </div>

                <div class="modal-body">
                    <form id="uploadForm"  method="post"  enctype="multipart/form-data">
                        <!-- 正文区域 -->
                        <div class="row data-type">
                            <div class="col-md-2 col-lg-2 col-xs-2 col-sm-2 title">ID</div>
                            <div class="col-md-10 col-lg-10 col-xs-10 col-sm-10 data">
                                <input type="text" class="form-control" name="id" id="upid" readonly="true">
                            </div>
                        </div>
                        <div class="row data-type">
                            <div class="col-md-2 col-lg-2 col-xs-2 col-sm-2 title">选择资料</div>
                            <div class="col-md-10 col-lg-10 col-xs-10 col-sm-10 data">
                                <input type="file" class="form-control" name="upload">
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" class="btn bg-maroon" onclick="uploadMeans()">保存</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        </div>
                </form>
            </div>
        </div>
    </div>
    <%--上传反馈资料模态框结束--%>

</div>
</section>
<!-- 正文区域 /-->
</div>
<!-- 内容区域 /-->
<!-- 底部导航 -->
<jsp:include page="footer.jsp"/>
<!-- 底部导航 /-->
</div>

<%--驳回意见模态框开始--%>
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="rejectModalLabel">填写驳回原因</h4>
            </div>

            <div class="modal-body">
                <form id="rejectkqfwForm" method="post">
                    <!-- 正文区域 -->
                    <div class="row data-type">
                        <div class="col-md-2 col-lg-2 col-xs-2 col-sm-2 title">任务Id</div>
                        <div class="col-md-10 col-lg-10 col-xs-10 col-sm-10 data">
                            <input type="text" class="form-control" name="reject_taskId" id="reject_taskId" readonly="readonly">
                        </div>
                        <div class="col-md-2 col-lg-2 col-xs-2 col-sm-2 title">任务状态</div>
                        <div class="col-md-10 col-lg-10 col-xs-10 col-sm-10 data">
                            <input type="text" class="form-control" name="reject_taskStatus" id="reject_taskStatus" readonly="readonly">
                        </div>
                        <div class="col-md-2 col-lg-2 col-xs-2 col-sm-2 title rowHeight2x">驳回原因</div>
                        <div class="col-md-10 col-lg-10 col-xs-10 col-sm-10 data rowHeight2x">
                            <textarea class="form-control" rows="3" name="reject_Info" id="reject_Info"></textarea>
                        </div>
                    </div>
                    <!-- 正文区域 /-->
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="subreject" onclick="reject()">提交</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<%--驳回意见模态框结束--%>

<script src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/raphael/raphael-min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/morris/morris.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="${pageContext.request.contextPath}/plugins/knob/jquery.knob.js"></script>
<script src="${pageContext.request.contextPath}/plugins/daterangepicker/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.js"></script>
<script src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/fastclick/fastclick.js"></script>
<script src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.js"></script>
<script src="${pageContext.request.contextPath}/plugins/select2/select2.full.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>
<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.js"></script>
<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="${pageContext.request.contextPath}/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/chartjs/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="${pageContext.request.contextPath}/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
    $(function (){
        // 按回车健获取文本框的值并检索数据
        $('#search-val').on('keydown',function(e){
            if (e.keyCode == 13) {
                var param=$(this).val();
                console.log(param);
                search(1,10,param);
            }

        });
        $('#btn-search').click(function(){
            var param=$('#search-val').val();
            console.log(param);
            search(1,10,param);
            return false;
        });

    });
    function search(page,pageSize,tl){
        window.open("${pageContext.request.contextPath}/kqfw/findTaskByNameAdmin.do?page="+page+"&pageSize="+pageSize+"&tl="+tl)
    }
    function changePageSize() {
        //获取下拉框的值
        var pageSize = $("#changePageSize").val();
        //向服务器发送请求，改变没页显示条数
        location.href = "${pageContext.request.contextPath}/kqfw/findTaskAdmin.do?page=1&pageSize="+pageSize;
    }
    function up(id){
        $('#upid').val(id);
    }
    function updateStatus(taskId,status){
            $.get("${pageContext.request.contextPath}/api/setStatus",{"id":taskId,"status":status},function (data){
                if (data.success==true){
                    if (data.data.type==2){
                        alert("成功退回申请！等待用户修改任务后再进行审核！");
                        window.location.reload();
                    }
                    if (data.data.type==3){
                        alert("审核成功！进入资料查找阶段！");
                        window.location.reload();
                    }
                    if (data.data.type==5){
                        alert("得到用户反馈！任务已完成归档！");
                        window.location.reload();
                    }
                }else{
                    alert("操作失败！");
                    window.location.reload();
                }

            },"json")
    }
    function uploadMeans(){
    	var formData = new FormData($("#uploadForm")[0]);
    	$.ajax({
    		url:'${pageContext.request.contextPath}/api/uploadMeans',
    		type:'post',
    		data:formData,
    		async:false,
    		cache:false,
    		contentType:false,
    		processData: false,
    		success:function (resp){
    			if (resp.success==true){
                    alert("上传反馈资料成功！");
                    window.location.reload();
                }else {
    			    alert("上传反馈资料失败！");
                    window.location.reload();
                }

    		},
    		error:function (error){
    			console.log(error);
    			alert("请求失败！请检查网络环境！");
                window.location.reload();
    		}
    	});
    }
    function bh(taskId,status){
        $("#rejectModal").modal('show');
        $("#reject_taskId").val(taskId);
        $("#reject_taskStatus").val(status);
    }
    function reject(){
        //获取表单数据
        var data=$("#rejectkqfwForm").serializeArray();
        $.post("${pageContext.request.contextPath}/api/reject",data,function (result){
            console.log(result);
            if (result.success==true){
                alert("成功退回申请！等待用户修改任务后再进行审核！");
                window.location.reload();
            }else {
                alert("驳回失败！");
                window.location.reload();
            }
        })
    }
</script>
</body>

</html>